import { useState, useEffect } from 'react';

import { findCities } from '@/api/MaiZuo';

const useCity = () => {
  const [list, setList] = useState([]);

  useEffect(() => {
    findCities().then((res) => {
      setList(res.cities);
    });
    return () => {};
  }, []);

  return {
    list,
  };
};

export { useCity };
